/*
 * 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SeleccionGastos.java
 *
 * Created on 3/10/2012, 10:39:15 PM
 */
package Intermedias;

import flujocaja.Manual;

/**
 *
 * @author HP G42
 */
public class SeleccionGastos extends javax.swing.JDialog {
    
    private int seleccion;

    /** Creates new form SeleccionGastos */
    public SeleccionGastos(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
    public int seleccionarGasto() {
        this.setTitle("Seleccionar tipo de gasto");
        this.setVisible(true);
        return this.seleccion;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        escalonados = new javax.swing.JButton();
        fijo = new javax.swing.JButton();
        segunVariable = new javax.swing.JButton();
        pronostico = new javax.swing.JButton();
        depreciaciones = new javax.swing.JButton();
        cancelar = new javax.swing.JButton();
        manual = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(flujocaja.FlujoCajaApp.class).getContext().getResourceMap(SeleccionGastos.class);
        escalonados.setText(resourceMap.getString("escalonados.text")); // NOI18N
        escalonados.setName("escalonados"); // NOI18N
        escalonados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                escalonadosActionPerformed(evt);
            }
        });

        fijo.setText(resourceMap.getString("fijo.text")); // NOI18N
        fijo.setName("fijo"); // NOI18N
        fijo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fijoActionPerformed(evt);
            }
        });

        segunVariable.setText(resourceMap.getString("segunVariable.text")); // NOI18N
        segunVariable.setName("segunVariable"); // NOI18N
        segunVariable.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                segunVariableActionPerformed(evt);
            }
        });

        pronostico.setText(resourceMap.getString("pronostico.text")); // NOI18N
        pronostico.setName("pronostico"); // NOI18N
        pronostico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pronosticoActionPerformed(evt);
            }
        });

        depreciaciones.setText(resourceMap.getString("depreciaciones.text")); // NOI18N
        depreciaciones.setName("depreciaciones"); // NOI18N
        depreciaciones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                depreciacionesActionPerformed(evt);
            }
        });

        cancelar.setText(resourceMap.getString("cancelar.text")); // NOI18N
        cancelar.setName("cancelar"); // NOI18N
        cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelarActionPerformed(evt);
            }
        });

        manual.setText(resourceMap.getString("manual.text")); // NOI18N
        manual.setName("manual"); // NOI18N
        manual.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                manualActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(44, 44, 44)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(cancelar)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(pronostico, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(depreciaciones, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(segunVariable, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(fijo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(escalonados, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(manual, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(63, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(escalonados)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(fijo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(segunVariable)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pronostico)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(depreciaciones)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(manual)
                .addGap(18, 18, 18)
                .addComponent(cancelar)
                .addContainerGap(46, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelarActionPerformed
        // TODO add your handling code here:
        seleccion = -1;
        this.dispose();
    }//GEN-LAST:event_cancelarActionPerformed

    private void escalonadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_escalonadosActionPerformed
        // TODO add your handling code here:
        seleccion = 0;
        this.dispose();
    }//GEN-LAST:event_escalonadosActionPerformed

    private void fijoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fijoActionPerformed
        // TODO add your handling code here:
        seleccion = 1;
        this.dispose();
    }//GEN-LAST:event_fijoActionPerformed

    private void segunVariableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_segunVariableActionPerformed
        // TODO add your handling code here:
        seleccion = 2;
        this.dispose();
    }//GEN-LAST:event_segunVariableActionPerformed

    private void pronosticoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pronosticoActionPerformed
        // TODO add your handling code here:
        seleccion = 3;
        this.dispose();
    }//GEN-LAST:event_pronosticoActionPerformed

    private void depreciacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_depreciacionesActionPerformed
        // TODO add your handling code here:
        seleccion = 4;
        this.dispose();
    }//GEN-LAST:event_depreciacionesActionPerformed

    private void manualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manualActionPerformed
        // TODO add your handling code here:
        seleccion = 5;
        this.dispose();        
    }//GEN-LAST:event_manualActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(SeleccionGastos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(SeleccionGastos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(SeleccionGastos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(SeleccionGastos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                SeleccionGastos dialog = new SeleccionGastos(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton cancelar;
    private javax.swing.JButton depreciaciones;
    private javax.swing.JButton escalonados;
    private javax.swing.JButton fijo;
    private javax.swing.JButton manual;
    private javax.swing.JButton pronostico;
    private javax.swing.JButton segunVariable;
    // End of variables declaration//GEN-END:variables

    
}
